package com.mdlib.helper.api;

import rx.Subscription;
import rx.subscriptions.CompositeSubscription;

/**
 * Created by librabin on 16/8/20.
 */
public abstract class MDPresenter {

    // rx总线
    private static CompositeSubscription compositeSubscription;

    public static void addSubscribe(Subscription subscription) {
        if (compositeSubscription == null) {
            compositeSubscription = new CompositeSubscription();
        }
        compositeSubscription.add(subscription);
    }

    public void unSubscribe() {
        if (compositeSubscription != null) {
            compositeSubscription.unsubscribe();
            compositeSubscription = null;
        }
    }


    //销去持有外部的mContext;
    public abstract void onDestory();





}
